package com.shop.front.vo.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.util.DecimalUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;

@ApiModel("UserIncomeStatisticVo 用户收益统计")
@Data
public class UserIncomeStatisticVo implements Serializable {

    @ApiModelProperty(value = "当前佣金", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal brokerage;

    @ApiModelProperty(value = "今日佣金收入", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal todayBroIncome;

    @ApiModelProperty(value = "昨日佣金收入", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal lastdayBroIncome;

    @ApiModelProperty(value = "累计已提金额", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal totalExtract;

    @ApiModelProperty(value = "今日未拼中收入", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal todayNotPzIncome;

    @ApiModelProperty(value = "今日团队收入", hidden = true)
    @JSONField(serialize = false)
    private BigDecimal todayTeamIncome;

    @ApiModelProperty("当前佣金")
    private String brokerageStr;
    public String getBrokerageStr() {
        if(StringUtils.isNotBlank(this.brokerageStr)) return this.brokerageStr;
        return DecimalUtil.str(this.brokerage);
    }

    @ApiModelProperty("今日佣金收入")
    private String todayBroIncomeStr;
    public String getTodayBroIncomeStr() {
        if(StringUtils.isNotBlank(this.todayBroIncomeStr)) return this.todayBroIncomeStr;
        return DecimalUtil.str(this.todayBroIncome);
    }

    @ApiModelProperty("昨日佣金收入")
    private String lastdayBroIncomeStr;
    public String getLastdayBroIncomeStr() {
        if(StringUtils.isNotBlank(this.lastdayBroIncomeStr)) return this.lastdayBroIncomeStr;
        return DecimalUtil.str(this.lastdayBroIncome);
    }

    @ApiModelProperty("累计已提金额")
    private String totalExtractStr;
    public String getTotalExtractStr() {
        if(StringUtils.isNotBlank(this.totalExtractStr)) return this.totalExtractStr;
        return DecimalUtil.str(this.totalExtract);
    }

    @ApiModelProperty("今日未拼中收入")
    private String todayNotPzIncomeStr;
    public String getTodayNotPzIncomeStr() {
        if(StringUtils.isNotBlank(this.todayNotPzIncomeStr)) return this.todayNotPzIncomeStr;
        return DecimalUtil.str(this.todayNotPzIncome);
    }

    @ApiModelProperty("今日团队收入")
    private String todayTeamIncomeStr;
    public String getTodayTeamIncomeStr() {
        if(StringUtils.isNotBlank(this.todayTeamIncomeStr)) return this.todayTeamIncomeStr;
        return DecimalUtil.str(this.todayTeamIncome);
    }
}